package com.karst.webnotes.chapter03
{
	import flash.display.Sprite;
	
	public class Chapter03Entry extends Sprite
	{
		public static const SECTION_LIST : Array = [1,2,3,4,5,6,7,8,9,10,11] ;
		
		public function Chapter03Entry()
		{
			super();
//			createView() ;
		}
		
		public function showSection( $section : int = 1 ) : void
		{
			while( numChildren )
				removeChildAt( 0 ) ;
			switch( $section )
			{
				case SECTION_LIST[0] :
					createSection01() ;
					break ;
				case SECTION_LIST[1] :
					createSection02() ;
					break ;
				case SECTION_LIST[2] :
					createSection03() ;
					break ;
				case SECTION_LIST[3] :
					createSection04() ;
					break ;
				case SECTION_LIST[4] :
					createSection05() ;
					break ;
				case SECTION_LIST[5] :
					createSection06() ;
					break ;
				case SECTION_LIST[6] :
					createSection07() ;
					break ;
				case SECTION_LIST[7] :
					createSection08() ;
					break ;
				case SECTION_LIST[8] :
					createSection09() ;
					break ;
				case SECTION_LIST[9] :
					createSection10() ;
					break ;
				case SECTION_LIST[10] :
					createSection11() ;
					break ;
				default :
					break ;
			}
		}

		private var plane : PlaneExample = null ;
		private function createSection01() : void
		{
			if( plane == null )
				plane = new PlaneExample() ;
			addChild( plane ) ;
		}
		
		private var sphere : SphereExample = null ;
		private function createSection02() : void
		{
			if( sphere == null )
				sphere = new SphereExample() ;
			addChild( sphere ) ;
		}
		
		private var cylinder : CylinderExample = null ;
		private function createSection03() : void
		{
			if( cylinder == null )
				cylinder = new CylinderExample() ;
			addChild( cylinder ) ;
		}
		
		private var cone : ConeExample = null ;
		private function createSection04() : void
		{
			if( cone == null )
				cone = new ConeExample() ;
			addChild( cone ) ;
		}
		
		private var cube : CubeExample = null ;
		private function createSection05() : void
		{
			if( cube == null )
				cube = new CubeExample() ;
			addChild( cube ) ;
		}
		
		private var paperPlane : PaperPlaneExample = null ;
		private function createSection06() : void
		{
			if( paperPlane == null )
				paperPlane = new PaperPlaneExample() ;
			addChild( paperPlane ) ;
		}
		
		private var arrow : ArrowExample = null ;
		private function createSection07() : void
		{
			if( arrow == null )
				arrow = new ArrowExample() ;
			addChild( arrow ) ;
		}
		
		private var nesting : NestingSample = null ;
		private function createSection08() : void
		{
			if( nesting == null )
				nesting = new NestingSample() ;
			addChild( nesting ) ;
		}
		
		private var do3d : DO3DExample = null ;
		private function createSection09() : void
		{
			if( do3d == null )
				do3d = new DO3DExample() ;
			addChild( do3d ) ;
		}
		
		private var vertice : VerticeExample = null ;
		private function createSection10() : void
		{
			if( vertice == null )
				vertice = new VerticeExample() ;
			addChild( vertice ) ;
		}
		
		private var vertices : VerticesExample = null ;
		private function createSection11() : void
		{
			if( vertices == null )
				vertices = new VerticesExample() ;
			addChild( vertices ) ;
		}
		
		private function createView() : void
		{

		}
	}
}